<div class="row">
  <div class="col-xs-12">

    <%= render partial: 'common/nav', locals: {show_tab: :index, model_nav_name: :admin_process_task, pjax: true} %>

    <%= form_for 'ProcessTask', url: admin_process_tasks_destroy_multi_path, method: :post do %>
        <button class="btn btn-minier btn-danger" type="submit">
          <i class="icon-trash"></i> <%= t 'common.delete_multi' %></button>
        <div id="admin_process_tasks">
          <%= grid(@process_tasks, show_filters: :when_filtered) do |g|
            g.action_column param_name: :select_ids, object_property: :id
            g.column name: "#{t 'activerecord.attributes.defaults.id'}", attribute: 'id', filter: false, ordering: true


            g.column name: "#{t 'activerecord.attributes.process_task.assignee_id'}", attribute: 'assignee_id'


            g.column name: "#{t 'activerecord.attributes.process_task.bpmn_define_id'}", attribute: 'bpmn_define_id'


            g.column name: "#{t 'activerecord.attributes.process_task.bpmn_name'}", attribute: 'bpmn_name'


            g.column name: "#{t 'activerecord.attributes.process_task.end_at'}", attribute: 'end_at'


            g.column name: "#{t 'activerecord.attributes.process_task.priority'}", attribute: 'priority'


            g.column name: "#{t 'activerecord.attributes.process_task.start_at'}", attribute: 'start_at'


            g.column name: "#{t 'activerecord.attributes.process_task.status'}", attribute: 'status'


            g.column name: "#{t 'activerecord.attributes.process_task.suspension_at'}", attribute: 'suspension_at'


            g.column do |c|
              grid_operator(:admin_process_task_path, c.id)

              link_to '处理', "/admin/engines/deal_with/#{c.id}"
            end
          end %>
        </div>

    <% end %>
  </div>
</div>

<script>
    $(function () {
        $('.nav.nav-list li.active').removeClass('active');
        $('.nav.nav-list li[data-model="process_task_list"]').addClass('active');
    });
</script>